"""
猜数字游戏
"""
import random
answer = random.randint(1,100)

counter = 0

while True:
    counter += 1
    num = int(input('请输入数字：'))
    if num == answer:
        print('恭喜你答对了')
        break
    elif num > answer:
        print('小一点')
    else:
        print('大一点')
print('你总共猜了%d次' % counter)
